package com.ljz.controller;

import com.ljz.entity.Car;
import com.ljz.service.impl.CarServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/car")
public class CarController {

    @Autowired
    private CarServiceImpl carService;

    @RequestMapping("/getCars")
    public List<Car> getCarList() {
        return carService.getCarList();
    }
    @RequestMapping("/delcCar")
    public String delcCar(@RequestBody List<Integer> ids) {
        return carService.delCarByIds(ids)>0?"true":"false";
    }
}
